﻿using System;
using System.Data;

namespace Dbam.DbFramework
{
	public interface IDbFactory
		: IDisposable
	{
		void AddInputOutputParam(IDbCommand command, string name, DbType type, object value);
		void AddInputParam(IDbCommand command, string name, DbType type, object value);
		void AddOutputParam(IDbCommand command, string name, DbType type, object value);
		void AddReturnValueParam(IDbCommand command, string name, DbType type, object value);
		void Connect(string connectionString);
		IDbConnection Connection { get; }
		IDataAdapter CreateAdapter(IDbCommand selectCommand, IDbCommand insertCommand, IDbCommand updateCommand, IDbCommand deleteCommand);
		IDbCommand CreateCommand(string commandText);
		IDataParameter CreateParam(string name, DbType type, ParameterDirection direction, object value);
		void Disconnect();
		DataSet ExecuteDataSet(IDbCommand command);
		DataTable ExecuteDataTable(string tableName, string filter, string sort);
	}
}
